import request from '@/utils/request'


export default {
    //查找所有商品
    alllist() {
        return request({
            url: '/api/alllist',
            method: 'get',
        })
    },

    //分页查找所有商品
    alllistByPage(current, limit) {
        return request({
            url: `/api/alllistByPage/${current}/${limit}`,
            method: 'get',
        })
    },

    //删除商品
    handleDelete(id) {
        return request({
            url: `/api/handleDelete/${id}`,
            method: 'delete',
        })
    },
    //根据id获取商品详细
    getProductById(id) {
        return request({
            url: `/api/getProductById/${id}`,
            method: 'get'
        })
    },
    //添加（保存）新的商品
    updateNew(data){
        return request({
            url: `/api/updateNew`,
            method: 'post',
            data
        })
    },
}